package com.tjtt.gwm.dao.impl;

import java.util.Map;

import com.tjtt.gwm.dao.ChuzhitaizhangDao;
import com.tjtt.tdm.base.BaseHibernateDao;
import com.tjtt.tdm.base.PageResult;

public class ChuzhitaizhangDaoImpl extends BaseHibernateDao implements ChuzhitaizhangDao {

	@Override
	public PageResult queryfengcunList(Map filterMap) {
		StringBuffer countString = new StringBuffer();
		countString.append("select count(*) from GWM_SHEBEIFENGCUN g where 1 = 1 ");
		StringBuffer queryString = new StringBuffer();
		queryString.append("select g.ID,g.EQUNAME,g.EQUORGNAME,g.CFANGDIDIAN,g.YUANYIN,g.ZHUANGTAI,g.SHENQINREN,g.SQDATE "+
		"from GWM_SHEBEIFENGCUN g where g.ZHUANGTAI like '%封存%' and 1=1");
		queryString.append(" order by g.ID desc");
		return searchBySQL(countString.toString(),queryString.toString(),filterMap);
	}

	@Override
	public PageResult queryxianzhiList(Map filterMap) {
		StringBuffer countString = new StringBuffer();
		countString.append("select count(*) from GWM_SHEBEIXIANZHI g where 1 = 1 ");
		StringBuffer queryString = new StringBuffer();
		queryString.append("select g.ID,g.EQUNAME,g.EQUORGNAME,g.EQUNO,g.CFANGDIDIAN,g.STATE,g.XZMIAOSHU,g.SHENQINREN,g.SQDATE "+
		"from GWM_SHEBEIXIANZHI g where g.STATE like '%闲置%' and 1=1");
		queryString.append(" order by g.ID desc");
		return searchBySQL(countString.toString(),queryString.toString(),filterMap);
	}

	@Override
	public PageResult querybaofeiList(Map filterMap) {
		StringBuffer countString = new StringBuffer();
		countString.append("select count(*) from TDM_APPLYS g where 1 = 1 ");
		StringBuffer queryString = new StringBuffer();
		queryString.append("select t.ID,t.IDENTIFICATION_ID,t.APP_NO, t.APP_EQU_NAME, t.APP_EQU_NO,t.APP_EQU_GJDATE,t.APP_EQU_YJSYNX, t.APP_SBYZ,t.APP_STATUS,"+ 
				"t.EQU_ORG_NAME,t.APP_GDZCNO, t.APP_NUMBER, t.APP_UNIT,"+ 
                "t.APP_SBGN, t.APP_PERSON, t.APP_DATE,t.APP_PINGSHENJIELUN  " +
				"from TDM_APPLYS t where t.APP_STATUS like '%报废%' and 1=1");
		queryString.append(" order by t.ID desc");
		return searchBySQL(countString.toString(),queryString.toString(),filterMap);
	}

	@Override
	public PageResult queryzaiyongList(Map filterMap) {
		StringBuffer countString = new StringBuffer();
		countString.append("select count(*) from GWM_SHEBEIFENGCUN g where 1 = 1 ");
		StringBuffer queryString = new StringBuffer();
		queryString.append("select g.ID,g.EQUNAME,g.EQUORGNAME,g.CFANGDIDIAN,g.YUANYIN,g.ZHUANGTAI,g.SHENQINREN,g.SQDATE "+
		"from GWM_SHEBEIFENGCUN g where g.ZHUANGTAI like '%在用%' and 1=1");
		queryString.append(" order by g.ID desc");
		return searchBySQL(countString.toString(),queryString.toString(),filterMap);
	}

	@Override
	public PageResult queryjinyongList(Map filterMap) {
		return null;
	}

	@Override
	public PageResult queryguzhangList(Map filterMap) {
		return null;
	}

}
